package com.appkubes.mall.admin.utils;

import com.github.pagehelper.PageInfo;
import lombok.Data;

import java.util.List;

/**
 * @Author: Rongjie
 * @Date: 2020/2/29
 * @Description: TODO: DELETE
 */
@Data
public class PageUtil<T> {

    private Integer code;
    private long count;
    private Integer page;
    private Integer limit;
    private List<T> data;
    private String uuid;
    private String msg;

    public PageUtil(PageInfo pageInfo) {
        this.code = 0;
        this.count = pageInfo.getTotal();
        this.page = pageInfo.getPageNum();
        this.limit = pageInfo.getSize();
        this.data = pageInfo.getList();
        this.uuid = "";
        this.msg = "";
    }

    public PageUtil(List<T> list, Integer page, Integer limit, int count) {
        this.code = 0;
        this.count = count;
        this.page = page;
        this.limit = limit;
        this.data = list;
        this.uuid = "";
        this.msg = "";
    }
}
